home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 218 / 218.d81 / t.c-64 f keys < prev    next >
Text File  |  2022-08-26  |  6KB  |  198 lines

  1. u
  2.         EZ C-64 FUNCTION KEYS
  3.  
  4.   Program and Text by James T. Jones
  5.  
  6.  
  7. NOTE: EACH TIME A FUNCTION KEY IS
  8. USED, THE SCREEN IS CLEARED TO DISPLAY
  9. THE INFORMATION. IF IMPORTANT
  10. INFORMATION IS ON THE SCREEN, USE ONE
  11. OF THE SCREEN SAVER PROGRAMS ON
  12. PREVIOUS ISSUES OF LOADSTAR BEFORE
  13. PROCEEDING.
  14.  
  15.  Our Beta Tester, Robin Harbron
  16. reports: I got an "OUT OF MEMORY"
  17. error when I hit F5 after doing some
  18. of the other functions -- F7, F1, F3.
  19. Seems F5 works when you first start
  20. the program, but after doing a
  21. directory, F5 produces the "? OUT OF
  22. MEMORY  ERROR".
  23.  
  24.  We will try to find a fix and publish
  25. it as soon as possible.
  26.  
  27.  
  28.  
  29.     On Issue 46 of LOADSTAR, there is
  30. a program, EASY KEYS, written by Steve
  31. Goldsmith, that gives you the
  32. capability to define the function
  33. keys, F1 to F8, on the C-64 in a
  34. manner similar to defining function
  35. keys on its uncle, the C-128, by using
  36. the KEY command.
  37.  
  38.     During a programming session, it
  39. is not unusual for me to encounter a
  40. number of problems: disk drive errors,
  41. the need to display the directory of a
  42. diskette without losing the program in
  43. memory, initializing the disk drive
  44. when errors occur, displaying the disk
  45. drive status, etc. Such problems are
  46. readily handled, but not without a
  47. great deal of typing. For example, in
  48. the direct mode, one can type
  49.  
  50.   CLOSE15:OPEN15,DV,15,"I":CLOSE15
  51.  
  52. (where DV is the device number of the
  53. disk drive) and press RETURN to
  54. initialize the disk drive.
  55.  
  56.     It would be much easier if one
  57. could simply press one of the function
  58. keys to accomplish the same result.
  59.  
  60.     In EASY KEYS, one types the
  61. command string for each of the eight
  62. function keys, F1 to F8. In this
  63. manner, each function key can be
  64. programmed to accomplish a given
  65. result. For example, by pressing F4,
  66. say, the status of the disk drive may
  67. be displayed. A major drawback of
  68. EASY KEYS, however, is that the
  69. function key assignments cannot be
  70. SAVEd, so that they are lost when the
  71. C-64 is turned off. At the start of a
  72. new programming session, the
  73. assignments have to be typed
  74. (tediously) again. Enter EZ C-64
  75. FUNCTION KEYS!
  76.  
  77.     LOAD and RUN the boot program,
  78. B.C-64 F KEYS, to execute the BASIC
  79. program, C-64 F KEYS.BAS. In the
  80. latter program, the assignments of the
  81. function keys are "hardcoded" in eight
  82. lines. These assignments may be
  83. readily changed by LISTing the program
  84. and changing the strings, f$(1) to
  85. f$(8), corresponding to F1 to F8,
  86. respectively.
  87.  
  88.     The operations obtained by press-
  89. ing the various function keys are
  90. discribed in the program.  There is an
  91. additional feature (an excellent
  92. memory aid), available in the direct
  93. mode, of displaying a summary of the
  94. function key assignments by pressing
  95. F7 or F8. In this case, use of
  96. CHR$(17) (cursor down) in the
  97. definitions of these function keys
  98. assures that a carriage return
  99. (CH$(13)) will not be executed on the
  100. text line, thus avoiding a SYNTAX
  101. error.
  102.  
  103.     For each new set of function key
  104. assignments, obtained by modifying
  105. C-64 F KEYS.BAS, a different program
  106. may be readily written and SAVEd. In
  107. a specific case, a list of the
  108. resulting file names and associated
  109. definitions of the function keys would
  110. be an aid to choosing the proper file
  111. to be LOADed and RUN.
  112.  
  113.     In EASY KEYS, a controlled input
  114. subroutine, originally published by
  115. Fender Tucker in one of his circulars,
  116. is used to enter the command strings
  117. corresponding to the function keys;
  118. however, the length of each string is
  119. limited to 38 characters, including
  120. control characters such as a carriage
  121. return (chr$(13)). In the present
  122. program, the maximum length of each
  123. command string is increased to 78
  124. characters, so that much more
  125. flexibility is available for the
  126. function key assignments. Of course,
  127. the main advantage of using EZ C-64
  128. FUNCTION KEYS is that the definitions
  129. can be SAVEd and reLOADed for the next
  130. programming session, thus avoiding
  131. much repetitive typing.
  132.  
  133.     In EASY KEYS, as in the present
  134. program, the range of addresses from
  135. 49408 onward is used as a buffer to
  136. store the data associated with the
  137. function key assignments. Caution
  138. should be observed in using this range
  139. of addresses for other purposes. Two
  140. object files, NEW DIR(52736).O and ERR
  141. MSG(53120).O, are BLOADed in the
  142. present program; however, their ranges
  143. of addresses do not overlap with the
  144. range of addresses of the buffer.
  145.  
  146.     The object file, EZ F KEYS.O, is
  147. used to lessen the time to access the
  148. data, in much the same manner as the
  149. keyboard buffer or queue (beginning at
  150. address 631) is used in the boot file,
  151. B.C-64 F KEYS, to LOAD and RUN the
  152. BASIC program, C-64 F KEYS.BAS. The
  153. source file, EZ F KEYS.S, cor-
  154. responding to the object file, is on
  155. this diskette.  The format of the
  156. MERLIN assembler is used.
  157.  
  158.     I haven't "hacked" the C-128 KEY
  159. command to any extent. It may be that
  160. an effort in this direction would
  161. yield useful information for
  162. reformulating a C-64 program for
  163. defining the C-64 function keys. In
  164. the meantime, you may find EZ C-64
  165. FUNCTION KEYS a useful adjunct to your
  166. programming.
  167.  
  168.  NOTE: Actually, when the KEY command
  169. is used, the maximum length for all
  170. the definitions of function keys
  171. together is 241 characters for the
  172. C-128, whereas in this program the
  173. maximum is 8*78=624, so that more
  174. flexibility is available. Of course,
  175. with the C-128 the function keys may
  176. be readily redefined in a program "on
  177. the run", so to speak.  For example,
  178. the LINE,
  179.  
  180. 10 KEY 2, "PRINT DS$" + CHR$(13)
  181.  
  182. tells the C-128 to check and display
  183. the disk drive error channel
  184. variables each time the F2 function
  185. key is pressed.
  186.  
  187.  JJ
  188.  
  189.  
  190.  DAVE'S NOTE: Dig into the Source File
  191. and learn how the magic is done!
  192. Thanks to Dr. Jack for climbing into
  193. so many older programs and bringing
  194. them into the 21st Century!
  195.  
  196.  DMM
  197.  
  198.  
  199.